object IntegerProcessing {
  def addOne(list: List[Int]): List[Int] = list.map(_ + 1)
  
  def filterEven(list: List[Int]): List[Int] = list.filter(_ %2 == 0)
  
  def mapReduce(list: List[Int], mapFn: Int => Int, reduceFn: (Int, Int) => Int): Int = {
    list.map(mapFn).reduce(reduceFn)
  }
}
val list=List(1,2,3,4,5,6,7,8,9,10)
val addOneList=addOne(list)
val evenList=filterEven(list)
val sum=mapReduce(list,x=>x*2,_+_)
println(addOneList) //输出List(2,3,4,5,6,7,8,9,10,11)

println(evenList) //输出List(2,4,6,8,10)

println(sum) //输出110

